<?php

namespace App\Http\Controllers\Api\V1;

use App\Http\Controllers\ApiController;
use App\Services\WorkOrder\WorkOrderService;

class WorkOrderController extends ApiController
{

    /**
     * @var WorkOrderService
     */
    protected $workOrderService;

    /**
     * WorkOrderController constructor.
     * @param WorkOrderService $workOrderService
     */
    public function __construct(WorkOrderService $workOrderService)
    {
        $this->workOrderService = $workOrderService;
    }

    /**
     * 获取工单订单列表
     * @author Min
     * @return mixed
     */
    public function getOrderList()
    {
        $user_id = 5960;
        $keyword = '';


        $data = $this->workOrderService->getOrderList($user_id, $keyword);

        return $this->success($data);
    }

    /**
     * 获取工单订单商品列表
     * @author Min
     * @return mixed
     */
    public function getOrderGoodsList()
    {
        $user_id = 5960;
        $order_id = 771872;

        $data = $this->workOrderService->getOrderGoodsList($user_id, $order_id);

        return $data;
    }
}
